<?php

/*   Description  of this file
 *    Author king-of-war
 *    Last Modified 2009-5-6
 *    This class designed  for the table operation
 */
@ session_start();
 echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';

$root_path = '../';
include_once $root_path . 'admin/smarty_config.php';
include_once $root_path . 'admin/class/db.class.php';
include_once $root_path . 'admin/class/verify.class.php';
$db = new db($root_path);
/*
 * check the right
 */
$check = new verify($root_path);
$check->identity_check(3);

/*
 * accept &&  delete
 */
if (isset ($_POST['Submit'])) {


	$dirs = array ();
	if (isset ($_POST['template_c']))
		$dirs[0] = 'templates_c/';
	if (isset ($_POST['admin/temp_c']))
		$dirs[1] = 'admin/temp_c/';

	if (count($dirs) > 0) {
		$line = $db->file_del($dirs);
		if ($line) {
			echo '优化成功';
		} else {
			echo '优化失败';
		}
	} else {
		echo '请先选择要处理的数据';
	}
}

/*
 * set the template for data_back.php
 */

$smarty->assign("dir", $root_path);
$smarty->display("data_optimiz.html");
?>